using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Package
{
    /// <summary>
    /// <para>Package Project</para>
    /// <para>Consolidates and packages a project (.aprx file) of referenced maps and data to a  packaged project file (.ppkx).</para>
    /// <para>将引用地图和数据的项目（.aprx 文件）合并并打包到打包的项目文件 （.ppkx） 中。</para>
    /// </summary>    
    [DisplayName("Package Project")]
    public class PackageProject : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PackageProject()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_project">
        /// <para>Input Project</para>
        /// <para>The project (.aprx file) to be packaged.</para>
        /// <para>要打包的项目（.aprx 文件）。</para>
        /// </param>
        /// <param name="_output_file">
        /// <para>Output File</para>
        /// <para>The output project package (.ppkx file).</para>
        /// <para>输出项目包（.ppkx 文件）。</para>
        /// </param>
        public PackageProject(object _in_project, object _output_file)
        {
            this._in_project = _in_project;
            this._output_file = _output_file;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Package Project";

        public override string CallName => "management.PackageProject";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_project, _output_file, _sharing_internal.GetGPValue(), _package_as_template.GetGPValue(), _extent, _apply_extent_to_arcsde.GetGPValue(), _additional_files, _summary, _tags, _version, _include_toolboxes.GetGPValue(), _include_history_items.GetGPValue(), _read_only.GetGPValue(), _select_related_rows.GetGPValue()];

        /// <summary>
        /// <para>Input Project</para>
        /// <para>The project (.aprx file) to be packaged.</para>
        /// <para>要打包的项目（.aprx 文件）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Project")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_project { get; set; }


        /// <summary>
        /// <para>Output File</para>
        /// <para>The output project package (.ppkx file).</para>
        /// <para>输出项目包（.ppkx 文件）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_file { get; set; }


        /// <summary>
        /// <para>Share outside of organization</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the project will be consolidated for your internal environment or will move all data elements so it can be shared externally.
        ///   <para>Data and maps will be consolidated and packaged if the project references them from a local path, such as c:\gisdata\landrecords.gdb\, regardless of this parameter's setting.</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Enterprise data sources, such as enterprise geodatabases and data from a UNC path, will not be copied to the local folder. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Data formats will be copied and preserved when possible.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是针对内部环境合并项目，还是移动所有数据元素，以便可以在外部共享项目。
        ///   <para>如果工程从本地路径（如 c：\gisdata\landrecords.gdb\）引用数据和地图，则无论此参数的设置如何，都将合并和打包数据和地图。</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不会将企业级数据源（例如企业级地理数据库和 UNC 路径中的数据）复制到本地文件夹。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将尽可能复制并保留数据格式。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Share outside of organization")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sharing_internal_value _sharing_internal { get; set; } = _sharing_internal_value._false;

        public enum _sharing_internal_value
        {
            /// <summary>
            /// <para>EXTERNAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXTERNAL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INTERNAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INTERNAL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Package as template</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to create a project template or a project package. Project templates can include maps, layouts, connections to databases and servers, and so on. A project template makes it easy to standardize a series of maps for different projects and to ensure the correct layers are immediately available for everyone to use in their maps.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Creates a project package. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Creates a project template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定是创建项目模板还是项目包。工程模板可以包括地图、布局、数据库和服务器的连接等。工程模板可以轻松标准化不同工程的一系列地图，并确保每个人都可以立即在其地图中使用正确的图层。
        ///   <bulletList>
        ///     <bullet_item>未选中 （Unchecked） - 创建工程包。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 创建工程模板。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Package as template")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _package_as_template_value _package_as_template { get; set; } = _package_as_template_value._false;

        public enum _package_as_template_value
        {
            /// <summary>
            /// <para>PROJECT_TEMPLATE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PROJECT_TEMPLATE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>PROJECT_PACKAGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PROJECT_PACKAGE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Extent</para>
        /// <para><xdoc>
        ///   <para>Specifies the extent that will be used to select or clip features.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Union of Inputs—The extent will be based on the maximum extent of all inputs.</bullet_item><para/>
        ///     <bullet_item>Intersection of Inputs—The extent will be based on the minimum area common to all inputs.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于选择或裁剪要素的范围。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>输入并集 - 范围将基于所有输入的最大范围。</bullet_item><para/>
        ///     <bullet_item>输入交点 - 范围将基于所有输入共有的最小面积。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _extent { get; set; } = null;


        /// <summary>
        /// <para>Apply Extent only to enterprise geodatabase layers</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the specified extent will be applied to all layers or only to enterprise geodatabase layers.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Extent will be applied to all layers. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Extent will be applied to enterprise geodatabase layers only.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定指定的范围是应用于所有图层还是仅应用于企业级地理数据库图层。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 范围将应用于所有图层。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 范围将仅应用于企业级地理数据库图层。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apply Extent only to enterprise geodatabase layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _apply_extent_to_arcsde_value _apply_extent_to_arcsde { get; set; } = _apply_extent_to_arcsde_value._false;

        public enum _apply_extent_to_arcsde_value
        {
            /// <summary>
            /// <para>ENTERPRISE_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ENTERPRISE_ONLY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ALL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Additional Files</para>
        /// <para>Adds additional files to a package. Additional files, such as .doc, .txt, .pdf, and so on, are used to provide more information about the contents and purpose of the package.</para>
        /// <para>将其他文件添加到包中。其他文件（如 .doc、.txt、.pdf 等）用于提供有关包的内容和用途的详细信息。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Additional Files")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _additional_files { get; set; } = null;


        /// <summary>
        /// <para>Summary</para>
        /// <para>Adds summary information to the properties of the package.</para>
        /// <para>将摘要信息添加到包的属性中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary { get; set; } = null;


        /// <summary>
        /// <para>Tags</para>
        /// <para>Adds tag information to the properties of the package. Multiple tags can be added or separated by a comma or semicolon.</para>
        /// <para>将标记信息添加到包的属性中。可以添加多个标签，也可以用逗号或分号分隔。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tags")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _tags { get; set; } = null;


        /// <summary>
        /// <para>Package version</para>
        /// <para><xdoc>
        ///   <para>Specifies the version of the geodatabases that will be created in the resulting package. Specifying a version allows packages to be shared with previous versions of ArcGIS and supports backward compatibility.
        ///   <para>A package saved to a previous version may lose properties available only in the newer version.</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>All versions— The package will contain geodatabases and maps compatible with all versions (ArcGIS Pro 2.1 and later).</bullet_item><para/>
        ///     <bullet_item>Current version— The package will contain geodatabases and maps compatible with the version of the current release.</bullet_item><para/>
        ///     <bullet_item>2.1—The package will contain geodatabases and maps compatible with version 2.1.</bullet_item><para/>
        ///     <bullet_item>2.2— The package will contain geodatabases and maps compatible with version 2.2.</bullet_item><para/>
        ///     <bullet_item>2.3—The package will contain geodatabases and maps compatible with version 2.3.</bullet_item><para/>
        ///     <bullet_item>2.4—The package will contain geodatabases and maps compatible with version 2.4.</bullet_item><para/>
        ///     <bullet_item>2.5—The package will contain geodatabases and maps compatible with version 2.5.</bullet_item><para/>
        ///     <bullet_item>2.6—The package will contain geodatabases and maps compatible with version 2.6.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定将在生成的包中创建的地理数据库的版本。指定版本允许与先前版本的 ArcGIS 共享包，并支持向后兼容性。
        ///   <para>保存到早期版本的包可能会丢失仅在较新版本中可用的属性。</para>
        ///   </para>
        ///   <bulletList>
        ///     <bullet_item>所有版本 - 该包将包含与所有版本（ArcGIS Pro 2.1 及更高版本）兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>当前版本 - 该包将包含与当前版本兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.1 - 包中将包含与版本 2.1 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.2 - 该包将包含与版本 2.2 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.3 - 包中将包含与版本 2.3 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.4 - 包中将包含与版本 2.4 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.5 - 包中将包含与版本 2.5 兼容的地理数据库和地图。</bullet_item><para/>
        ///     <bullet_item>2.6 - 包中将包含与版本 2.6 兼容的地理数据库和地图。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Package version")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _version { get; set; } = null;


        /// <summary>
        /// <para>Include Toolboxes</para>
        /// <para><xdoc>
        ///   <para>Specifies whether project toolboxes, and the data referenced by the tools in the project toolboxes, will be consolidated and included in the output package. All projects require a default toolbox, and the default toolbox will be included regardless of this setting. A toolbox inside a connected folder is not considered a project toolbox and is not impacted by this setting.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Project toolboxes will be included in the output package. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Project toolboxes will be excluded from the output package.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将项目工具箱以及项目工具箱中的工具引用的数据合并并包含在输出包中。所有工程都需要一个默认工具箱，无论此设置如何，都将包含默认工具箱。连接文件夹中的工具箱不被视为项目工具箱，并且不受此设置的影响。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 工程工具箱将包含在输出包中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 工程工具箱将从输出包中排除。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include Toolboxes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _include_toolboxes_value _include_toolboxes { get; set; } = _include_toolboxes_value._true;

        public enum _include_toolboxes_value
        {
            /// <summary>
            /// <para>TOOLBOXES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("TOOLBOXES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_TOOLBOXES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_TOOLBOXES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include History Items</para>
        /// <para><xdoc>
        ///   <para>Specifies whether geoprocessing history items will be consolidated and included in the output package. Included history items will consolidate the data required to re-execute said history item.</para>
        ///   <bulletList>
        ///     <bullet_item>History items will be included—History items will be included in the output package. This is the default.</bullet_item><para/>
        ///     <bullet_item>History items will be excluded—History items will be excluded from the output package.</bullet_item><para/>
        ///     <bullet_item>Only valid history items will be included—Only valid history items will be included in the output package. History items are invalid if any of the original input layers or tools cannot be found.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将地理处理历史项目合并并包含在输出包中。包含的历史记录项将合并重新执行所述历史记录项所需的数据。</para>
        ///   <bulletList>
        ///     <bullet_item>将包括历史记录项目 - 历史记录项目将包含在输出包中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>历史记录项目将被排除 - 历史记录项目将从输出包中排除。</bullet_item><para/>
        ///     <bullet_item>仅包含有效的历史记录项目 - 输出包中仅包含有效的历史记录项目。如果找不到任何原始输入图层或工具，则历史记录项目无效。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include History Items")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _include_history_items_value _include_history_items { get; set; } = _include_history_items_value._HISTORY_ITEMS;

        public enum _include_history_items_value
        {
            /// <summary>
            /// <para>History items will be included</para>
            /// <para>History items will be included—History items will be included in the output package. This is the default.</para>
            /// <para>将包括历史记录项目 - 历史记录项目将包含在输出包中。这是默认设置。</para>
            /// </summary>
            [Description("History items will be included")]
            [GPEnumValue("HISTORY_ITEMS")]
            _HISTORY_ITEMS,

            /// <summary>
            /// <para>History items will be excluded</para>
            /// <para>History items will be excluded—History items will be excluded from the output package.</para>
            /// <para>历史记录项目将被排除 - 历史记录项目将从输出包中排除。</para>
            /// </summary>
            [Description("History items will be excluded")]
            [GPEnumValue("NO_HISTORY_ITEMS")]
            _NO_HISTORY_ITEMS,

            /// <summary>
            /// <para>Only valid history items will be included</para>
            /// <para>Only valid history items will be included—Only valid history items will be included in the output package. History items are invalid if any of the original input layers or tools cannot be found.</para>
            /// <para>仅包含有效的历史记录项目 - 输出包中仅包含有效的历史记录项目。如果找不到任何原始输入图层或工具，则历史记录项目无效。</para>
            /// </summary>
            [Description("Only valid history items will be included")]
            [GPEnumValue("VALID_HISTORY_ITEMS_ONLY")]
            _VALID_HISTORY_ITEMS_ONLY,

        }

        /// <summary>
        /// <para>Read Only Package</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the project will be read only. Read only projects cannot be modified or saved.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Project will be read only.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Project is writable. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定项目是否为只读。只读项目无法修改或保存。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 项目将为只读。</bullet_item><para/>
        ///     <bullet_item>未选中 - 项目可写。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Read Only Package")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _read_only_value _read_only { get; set; } = _read_only_value._false;

        public enum _read_only_value
        {
            /// <summary>
            /// <para>READ_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("READ_ONLY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>READ_WRITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("READ_WRITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Keep only the rows which are related to features within the extent</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the specified extent will be applied to related data sources.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Related data sources will be consolidated in their entirety. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Only related data corresponding to records within the specified extent will be consolidated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将指定的范围应用于相关数据源。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 相关数据源将全部合并。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 仅合并与指定范围内的记录对应的相关数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep only the rows which are related to features within the extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _select_related_rows_value _select_related_rows { get; set; } = _select_related_rows_value._false;

        public enum _select_related_rows_value
        {
            /// <summary>
            /// <para>KEEP_ONLY_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ONLY_RELATED_ROWS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>KEEP_ALL_RELATED_ROWS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ALL_RELATED_ROWS")]
            [GPEnumValue("false")]
            _false,

        }

        public PackageProject SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}